﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lenovo.CFI.Common
{
    public class Topic
    {
        public Topic()
        { }

        public Topic(int id)
        {
            this.id = id;
        }

        private int id;
        private string title;
        private int year;
        private string no;
        private string type;
        private string tdc;
        private Guid? pptFileID;
        private TopicStatus status;
        private DateTime createTime;
        private DateTime? startTime;
        private DateTime? deadlineTime;
        private DateTime? reviewTime;
        private DateTime? actionTime;
        private DateTime? executeTime;
        private DateTime? closeTime;

        private DateTime? suggestDate;
        private DateTime? reportDate;
        private DateTime? materialDate;
        private DateTime? mktDate;
        private string principal;


        public int ID
        {
            get { return id; }
            set { id = value; }
        }

        public string Title
        {
            get { return title; }
            set { title = value; }
        }

        public int Year
        {
            get { return year; }
            set { year = value; }
        }

        public string No
        {
            get { return no; }
            set { no = value; }
        }

        public string Type
        {
            get { return type; }
            set { type = value; }
        }

        public string Tdc
        {
            get { return tdc; }
            set { tdc = value; }
        }

        public Guid? PptFileID
        {
            get { return pptFileID; }
            set { pptFileID = value; }
        }

        public TopicStatus Status
        {
            get { return status; }
            set { status = value; }
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime
        {
            get { return createTime; }
            set { createTime = value; }
        }

        /// <summary>
        /// 启动日期，此后可以提交Idea
        /// </summary>
        public DateTime? StartTime
        {
            get { return startTime; }
            set { startTime = value; }
        }

        /// <summary>
        /// 截止日期，此日以后不能再提交Idea
        /// </summary>
        public DateTime? DeadlineTime
        {
            get { return deadlineTime; }
            set { deadlineTime = value; }
        }

        /// <summary>
        /// 评审日期，此日开始可以进行评审
        /// </summary>
        public DateTime? ReviewTime
        {
            get { return reviewTime; }
            set { reviewTime = value; }
        }

        /// <summary>
        /// Action开始时间，仅仅记录
        /// </summary>
        public DateTime? ActionTime
        {
            get { return actionTime; }
            set { actionTime = value; }
        }

        /// <summary>
        /// Execute开始时间，仅仅记录
        /// </summary>
        public DateTime? ExecuteTime
        {
            get { return executeTime; }
            set { executeTime = value; }
        }

        /// <summary>
        /// Close开始时间，仅仅记录
        /// </summary>
        public DateTime? CloseTime
        {
            get { return closeTime; }
            set { closeTime = value; }
        }

        public DateTime? SuggestDate
        {
            get { return suggestDate; }
            set { suggestDate = value; }
        }

        public DateTime? ReportDate
        {
            get { return reportDate; }
            set { reportDate = value; }
        }

        public DateTime? MaterialDate
        {
            get { return materialDate; }
            set { materialDate = value; }
        }

        public DateTime? MktDate
        {
            get { return mktDate; }
            set { mktDate = value; }
        }

        public string Principal
        {
            get { return principal; }
            set { principal = value; }
        }



        /// <summary>
        /// 状态描述
        /// </summary>
        public string StatusText
        {
            get 
            {
                string text = "";
                switch (this.status)
                {
                    case TopicStatus.Create:
                        text = "Create";
                        break;
                    case TopicStatus.Start:
                        text = "Start";
                        break;
                    case TopicStatus.Schedule:
                        text = "Schedule";
                        break;
                    case TopicStatus.Reviewer:
                        text = "Reviewer";
                        break;
                    case TopicStatus.Review:
                        text = "Reviewing";
                        break;
                    case TopicStatus.Summary:
                        text = "Summary";
                        break;
                    case TopicStatus.Suggestion:
                        text = "Suggestion";
                        break;
                    case TopicStatus.Execution:
                        text = "Execution";
                        break;
                    case TopicStatus.Closed:
                        text = "Closed";
                        break;
                }

                return text; 
            }
        }
    }

    public enum TopicStatus
    {
        /// <summary>
        /// 创建
        /// </summary>
        Create = 0,
        /// <summary>
        /// 启动 -- 在指定时间范围内可以提交Idea
        /// </summary>
        Start = 1,
        /// <summary>
        /// 安排评审日程 -- 不能再提交Idea
        /// </summary>
        Schedule = 2,
        /// <summary>
        /// 安排评审评委
        /// </summary>
        Reviewer = 3,
        /// <summary>
        /// 评审 -- 在指定时间范围内可以进行评审
        /// </summary>
        Review = 4,
        /// <summary>
        /// 汇总
        /// </summary>
        Summary = 5,
        /// <summary>
        /// 确定NextAction
        /// </summary>
        Suggestion = 6,
        /// <summary>
        /// 执行
        /// </summary>
        Execution = 7,
        /// <summary>
        /// 关闭
        /// </summary>
        Closed = 8,
    }
}
